﻿@model dynamic

@{
    Script.Require("jQuery").AtFoot();
    Script.Include("popbox.min.js").AtFoot();
    Style.Include("popbox.css").AtFoot();

    var url = Url.Action("LoginShape", "Shapes", new { Area = "Contrib.Mod.AccountWidgets" });
    var returnUrl = Request.Url.PathAndQuery;
    if (returnUrl.Contains("/Users/Account/AccessDenied"))
    {
        returnUrl = Request.QueryString["ReturnUrl"];
    }
    var action = "/Users/Account/LogOn?ReturnUrl=" + returnUrl; 
}

<div id="popbox-login-bigbob-007" style="width: 500px;">
<div class='popbox'>
    <a class='open' href='#'>Log In
    </a>

    <div class='collapse' >
      <div class='box'>
        <div class='arrow'></div>
        <div class='arrow-border'></div>

        <div id="popbox-login-bob-007">
        <form action="http://gristmill.createsend.com/t/j/s/zlldr/" method="post" id="subForm">
          <p><small>Please complete the form to sign up for the <a href="http://gristmill.io" target="_blank">Gristmill</a> mailing list!</small></p>
          <div class="input">
            <input type="text" name="cm-name" id="name" placeholder="Name" />
          </div>
          <div class="input">
            <input type="text" name="cm-zlldr-zlldr" id="zlldr-zlldr" placeholder="Email" />
          </div>
          <input type="submit" value="Sign Up" /> <a href="#" class="close">Cancel</a>
        </form>
        </div>
      </div>
    </div>
  </div>
</div>
@returnUrl

@using (Script.Foot())
{
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: '@url',
                success: function(data){
                    $("#popbox-login-bob-007").html(data);
                    $("#popbox-login-bob-007 form").get(0).setAttribute('action', '@action');
                    $('#popbox-login-bigbob-007 .popbox').popbox();
                }
            });

            
        });
    </script>
}